<?php
require './library/db_constants.php';
require './library/planets.php';
require './library/deposits.php';
// Call planets class for the createPlanet function.
$planets = new planets;
$deposits = new deposits;
?>
<!DOCTYPE html>
<html>
    <head>
        <title>SWC Prospecting Manager || List Planets</title>
        <link rel="stylesheet" href="./library/css/listPlanets.css" />
        <script type="text/javascript">
            function confirm_alert(node) {
                return confirm("Please click on OK to continue.");
            }
        </script>
    </head>
    <body>
        <h1>List/Edit Planets</h1>
        
        <hr />
        
        <div id="planetList">
            <fieldset>
                <legend>List of Planets</legend>
                    <div id="name_header">Name</div> 
                    <div id="size_header">Size</div>
                    <div id="deposits_header">Deposits</div>
                    <div id="edit_delete_header">Edit/Delete</div>
                    <?php $planets->listPlanets();?>
            </fieldset>
        </div>
        <footer>
            <a href="index.php">Home</a> || <a href="createPlanet.php">Create Planet</a> ||
            <a href="createDeposit.php">Create Deposit</a> || <a href="listDeposits.php">List/Edit Deposits</a>
        </footer>
    </body>
</html>